perm filename INTOPS.PAL[HAL,HE]1 blob sn#155553 filedate 1975-04-24 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.SBTTL	Table of interpreter instructions
C00006 ENDMK
C⊗;
.SBTTL	Table of interpreter instructions

;This is parallel to the file INTDEF.SAI[H,RF]

	II == 0		;Start of interpreter jump table
	;Motion control
	;PREPMOVE
	;STARTMOVE

	;Variable declaration
MAKEOP	(XVARIABLE,VARIABLE);o,a	;Put a ptr to a at offset o, current level.

	;Stack operations
MAKEOP	XGTVAL,GTVAL;a	;Push value of arg (level-offset pair).
MAKEOP  XCHNGE,CHNGE;a	;Pop value into arg (level-offset pair).
MAKEOP	XPUSH, PUSH ;a	;Push arg directly (as a ptr) onto stack. For cnstnts.
MAKEOP	XPOP,  POP	;Pop stack.
MAKEOP	XCOPY, COPY ;n	;Copy n'th down to top of stack.
MAKEOP	XREPLAC,REPLAC;n;Replace n'th down with top (which pop)
MAKEOP	XFLUSH,FLUSH	;Flush the entire stack.

	;Flow of control
MAKEOP	XJUMP, JUMP ;a	;Jump to address
MAKEOP	XJUMPZ,JUMPZ;a	;Jump to address only if top zero (which pop)
MAKEOP	XTERMINATE,TERMINATE	;Terminate this interpreter
MAKEOP  XPROC, PROC;d,al;Call a procedure at d, with arg list al.
MAKEOP	XRETURN,RETURN	;Return from procedure
MAKEOP	XSPROUT,SPROUT;d;Sprout an interpreter at d.
MAKEOP	XFORCHK,FORCHK;d;Do a FOR-loop check, and fail to location d.

	;Arithmetic
MAKEOP	XSADD, SADD	;S+S:  Add top two elts, pop, pop, push answer
MAKEOP	XSSUB, SSUB	;S-S:  Sub top two elts, pop, pop, push answer
MAKEOP	XSMUL, SMUL	;S*S:  Mul top two elts, pop, pop, push answer
MAKEOP	XSDIV, SDIV	;S/S:  Div top two elts, pop, pop, push answer
MAKEOP	XSNEG, SNEG	;-S:   Negate top elt, pop, push answer
MAKEOP	XVMAG, VMAG	;Scalar ← norm of vector
MAKEOP	XSVMUL,SVMUL	;Vector ← scalar * vector
MAKEOP	XVDOT, VDOT	;S ← vector dot vector
MAKEOP	XPVDOT,PVDOT	;S ← vector dot vector
MAKEOP	XVMAKE,VMAKE	;V ← vector(scalar,scalar,scalar)
MAKEOP	XVADD, VADD	;V ← vector + vector
	;UNITV remove	;Vector ← vector / its norm
	;CROSV remove	;Vector ← vector cross vector
MAKEOP	XTVMUL,TVMUL	;Vector ← trans * vector
	;FTOF
MAKEOP	XTMAKE,TMAKE	;Trans ← trans(rot,vector)
	;TTMUL
	;TINV